home *** CD-ROM | disk | FTP | other *** search
/ PC-X 1997 October / pcx14_9710.iso / swag / delphi.swg / 0043_Moving to a tab by name on a TabSet.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1995-11-22  |  592 b   |  27 lines

  1.  
  2. Moving to a page by name on a TabSet.
  3.  
  4. Place a Tabset(TabSet1) and an Edit (Edit1) on
  5. your form. Change the Tabset's Tabs Property in
  6. the String List Editor to include 4 Tabs:
  7.              Hello, 
  8.              World, 
  9.              Of,
  10.              Delphi,
  11.    
  12. Change Edit1's onChange event to:
  13.  
  14. procedure TForm1.Edit1Change(Sender: TObject);
  15. var
  16.   I : Integer;
  17. begin
  18.   for  I:= 0 to tabset1.tabs.count-1 do
  19.    if  edit1.text = tabset1.tabs[I] then
  20.      tabset1.tabindex:=I;
  21.  
  22. end;
  23.  
  24. If You type any of the Tabs names in edit1 it 
  25. will focus on the appropriate tab.
  26.  
  27.